id/email
password
forgot password | create account
about | help | prefs
ReadingBatcode reading practice

 

 

Athenian: Loopswhile1

prev  |  next  |  chance

Reading while loops

def countup(n):
    total = 0
    while n < 5:
        total = total + n
        n += 1
    return total
Function Call  Return Value
countup(0)
countup(3)
countup(-2)

Experiment with this code on Gitpod.io

⬅ Back